<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="../js/vue.js"></script>
    <!-- 引入样式 -->
    <link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-chalk/index.css">
    <!-- 引入组件库 -->
    <script src="https://unpkg.com/element-ui/lib/index.js"></script>
    <style>

    </style>
</head>

<body>
    <div id="root">
        
    </div>

    <script>
        // 创建student组件
        const student = Vue.extend({
            name:'student',
            template: `
            <div>
            <h2>学校名称：{{studentName}}</h2>
            <h2>学校地址：{{age}}</h2>
            
            </div>`,

            data() {
                return {
                    studentName: '涵爷',
                    age: 18

                }
            },
        })


        // 创建school组件
        const school = Vue.extend({
            name:'school',
            template: `
            <div>
            <h2>学校名称：{{schoolName}}</h2>
            <h2>学校地址：{{address}}</h2>
            <student></student>
            </div>`,

            data() {
                return {
                    schoolName: '家里蹲',
                    address: '湖北武汉',
                }
            },
            components: {
                student:student
            }
        })
        //创建hello组件

        const hello = Vue.extend({
            name:'hello',
            template: `
        <div><h2>{{msg}}</h2></div>

            `,
            data() {
                return {
                    msg: 'xiba'
                }
            },
        })
        //创建app组件 
        const app = Vue.extend({
            template: `
            <div>
            <hello></hello>
            <school></school>
        </div>
            `,
            components: {
                hello,
                school
            }
        })
        new Vue({
            el: '#root',
            template:`
            <app></app>
            `,
            components: {
                app
            }

        })
    </script>
</body>

</html>